package net.siufung.boot.datasource.service.impl;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.siufung.boot.datasource.dto.ConnDto;
import net.siufung.boot.datasource.dto.TableNamesDto;
import net.siufung.boot.datasource.entity.TableInfo;
import net.siufung.boot.datasource.service.IDatasourceService;
import net.siufung.boot.datasource.utils.DatasourceUtil;

import java.sql.Connection;
import java.util.List;

/**
 * @author 陈建峰
 * @since 2022/8/15 5:59 下午
 */
@Slf4j
@AllArgsConstructor
public class DatasourceServiceImpl implements IDatasourceService {

    @Override
    public Connection getConn(ConnDto connDto) {
        return DatasourceUtil.getConn(connDto);
    }

    @Override
    public List<TableInfo> getTableInfoList(TableNamesDto tableNamesDto) {
        return DatasourceUtil.getTableInfoList(tableNamesDto);
    }

    @Override
    public List<TableInfo> getTableInfoList(TableNamesDto tableNamesDto, Boolean ignoreField) {
        return DatasourceUtil.getTableInfoList(tableNamesDto, ignoreField);
    }

}
